<template>
  <div class="box">
    <h1>标题:{{ title }}</h1>
    <p>价格:{{ price }}</p>
    <p>开业大酬宾,全场8折</p>
    <button @click="changePrice">调整价格</button>
  </div>
</template>
<script>
export default {
    props:['title','price','id'],
    data(){
        return{

        }
    },
    methods:{
        changePrice(){
            console.log('触发changePrice函数');
            this.$emit('toPrice',9,this.id)
        },
        getSum(num1,num2){
            let sum =  num1 + num2
            console.log(sum);
        }
    }
}
</script>

<style>
.box{
    border: 3px solid #000;
    border-radius: 10px;
    width: 500px;
    padding: 10px;
}
</style>